import request from '@/utils/request'

/**
 * 新增
 * @param {Object} data
 * @returns
 */
export function addPosition(data) {
  return request({
    url: '/tissue/position/addPosition',
    headers: { repeatSubmit: false },
    method: 'post',
    data
  })
}

/**
 * 修改
 * @param {Object} data
 * @returns
 */
export function updatePosition(data) {
  return request({
    url: '/tissue/position/updatePosition',
    method: 'post',
    data
  })
}

/**
 * 详情
 * @param {String} positionId
 * @returns
 */
export function getPositionDetail(positionId) {
  return request({
    url: '/tissue/position/positionDetail',
    method: 'get',
    params: { positionId }
  })
}

/**
 * 管理
 * @param {Object} params
 * @returns
 */
export function getPositionList(params) {
  return request({
    url: '/tissue/position/conditionsPosition',
    method: 'get',
    params
  })
}

/**
 * 禁、启用
 * @param {Object} params
 * @returns
 */
export function disablePoint(params) {
  params.enabled = params.enabled == '1' ? '0' : '1'

  return request({
    url: '/tissue/position/positionProhibit',
    method: 'get',
    params
  })
}

/**
 * 根据区域id 查询点位列表
 * @returns
 */
export function getQueryPointApi(params) {
  return request({
    url: '/tissue/position/findByAreaId',
    method: 'get',
    params
  })
}
